package com.molin.API.test1;

public class Demo2StringBuilder {
    public static void main(String[] args) {
        StringBuilder sb=new StringBuilder();
//        sb.append("红色");
//        System.out.println(sb);
//        sb.append("蓝色");
//        System.out.println(sb);
//        sb.append("绿色");
//        System.out.println(sb);

        //链式编程
        sb.append("红色").append("绿色").append("蓝色");
        System.out.println(sb);
        System.out.println(sb.reverse());
        System.out.println(sb.length());
        String s=sb.reverse().toString();
        System.out.println(s);
    }
}
